package router

import (
	platformController "gitee.com/wangshh_123/cross-pay-go/src/controller/platform"
	"gitee.com/wangshh_123/cross-pay-go/src/middleware"
	"github.com/gin-gonic/gin"
)

// SetupCardCVVRouter 设置统一的卡片CVV路由
func SetupCardCVVRouter(api *gin.RouterGroup) {
	// 创建统一的CVV控制器实例
	cardCVVController := platformController.NewCardCVVController()

	// CVV路由组
	cvv := api.Group("/card-cvv")
	{
		// 基础CVV查询 - 根据用户平台自动选择
		cvv.GET("/", middleware.AuthMiddleware(), middleware.PlatformInfoMiddleware(), cardCVVController.GetCardCVV)

		// 指定平台CVV查询 - 管理员功能
		cvv.GET("/platform/:platform", middleware.AuthMiddleware(), cardCVVController.GetCardCVVByPlatform)

		// 获取支持CVV查询的平台列表
		cvv.GET("/platforms", cardCVVController.GetSupportedPlatforms)
	}
}
